@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li><a href="#">财务管理</a></li>
	<li class="active"><a href="{{ url('admin/turn') }}">第三方充值记录</a></li>
</ul><!-- /.breadcrumb -->

</div>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="search-area well col-xs-12">
					<form action="">
						<div class="pull-left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">账户ID: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="account"/>
							</div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-list"></i>
							<b class="text-primary">*开始时间 </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="start_time" id="start_at" />
							</div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-crosshairs"></i>
							<b class="text-primary">*结束时间 </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="end_time" id="back_date" />
							</div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="submit" class="btn btn-white btn-info btn-bold">查询</button>
						</div>
					</form>
				</div>
			</div>


			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-xs-12">
					<!-- div.table-responsive -->
					<!-- div.dataTables_borderWrap -->
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>订单号</th>
									<th>账户ID</th>
									<th>充值金额</th>
									<th>手续费</th>
									<th>实际金额</th>
									<th>提交时间</th>
									<th>充值状态</th>
								</tr>
							</thead>

							<tbody>
								@foreach($data as $key=>$value)
									<tr>
										<td>{{$page_num+$key}}</td>
										<td>{{$value->order_no}}</td>
										<td>{{$value->user->account}}</td>
										<td>{{$value->num}}</td>
										<td>{{$value->proc}}</td>
										<td>{{$value->real_num}}</td>
										<td>{{$value->created_at}}</td>
										<td>{{\App\Models\Turn::$STATUS[$value->status]}}</td>
									</tr>
								@endforeach
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->

	</div><!-- /.row -->
	<div class="no-margin-top">
		<ul class="pagination pull-right no-margin">
			{{$data->appends(['account'=>$account,'start_time'=>$start_time,'end_time'=>$end_time])->links()}}
		</ul>
	</div>
</div><!-- /.page-content -->

@endsection

@section('after.js')
    <script src="{{asset('/data/laydate.dev.js')}}"></script>
    <script type="text/javascript">
        var start_at = {
          elem: '#start_at',
          format: 'YYYY-MM-DD hh:mm:ss',
          min: '2018-01-01', //设定最小日期为当前日期
          max: '2099-06-16', //最大日期
          istime: true,
          istoday: false,
          choose: function(datas){

          }
        };
        var back_date = {
          elem: '#back_date',
          format: 'YYYY-MM-DD hh:mm:ss',
          min: '2018-01-01', //设定最小日期为当前日期
          max: '2099-06-16', //最大日期
          istime: true,
          istoday: false,
          choose: function(datas){

          }
        };
        laydate(start_at);
        laydate(back_date);

    </script>
@endsection
